No side effects in BUG_ON statements in Xen.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 27 Oct 2005 17:21:57 +0000 (18:21 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 27 Oct 2005 17:21:57 +0000 (18:21 +0100)
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/mm.c
xen/arch/x86/time.c
xen/common/schedule.c

index a292bb12f92de680469efe213cec5053e364c9b4..5664b88d8acf94ca3fbdf302617705edef9c8ee6 100644 (file)
@@ -1164,6 +1164,7 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
 {
     l3_pgentry_t ol3e;
     unsigned long vaddr;
+    int okay;
 
     if ( unlikely(!is_guest_l3_slot(pgentry_ptr_to_slot(pl3e))) )
     {
@@ -1218,7 +1219,9 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
         return 0;
     }
 
-    BUG_ON(!create_pae_xen_mappings(pl3e));
+    okay = create_pae_xen_mappings(pl3e);
+    BUG_ON(!okay);
+
     put_page_from_l3e(ol3e, pfn);
     return 1;
 }
index f91c377999f45a8d55a3f7f12376c1788b4144bd..b5f7023bd6dbf9fc374f2c0fe5f5404cfb200c2e 100644 (file)
@@ -323,7 +323,7 @@ static u64 read_pit_count(void)
     return pit_counter64 + (u16)(pit_stamp - pit_read_counter());
 }
 
-static int init_pit(void)
+static void init_pit(void)
 {
     read_platform_count = read_pit_count;
 
@@ -333,8 +333,6 @@ static int init_pit(void)
 
     printk("Platform timer is %s PIT\n", freq_string(CLOCK_TICK_RATE));
     using_pit = 1;
-
-    return 1;
 }
 
 /************************************************************
@@ -563,7 +561,7 @@ static void platform_time_calibration(void)
 static void init_platform_timer(void)
 {
     if ( !init_cyclone() && !init_hpet() )
-        BUG_ON(!init_pit());
+        init_pit();
 }
 
 
index 4c58a8d68e950b16739e918011d0b18677991719..da344c77dba890a10ff2934ade9394ae603be2e8 100644 (file)
@@ -514,7 +514,7 @@ static void dom_timer_fn(void *data)
 /* Initialise the data structures. */
 void __init scheduler_init(void)
 {
-    int i;
+    int i, rc;
 
     open_softirq(SCHEDULE_SOFTIRQ, __enter_scheduler);
 
@@ -540,7 +540,9 @@ void __init scheduler_init(void)
 
     printk("Using scheduler: %s (%s)\n", ops.name, ops.opt_name);
 
-    BUG_ON(SCHED_OP(alloc_task, idle_task[0]) < 0);
+    rc = SCHED_OP(alloc_task, idle_task[0]);
+    BUG_ON(rc < 0);
+
     sched_add_domain(idle_task[0]);
 }